package com.qzboot.facade.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.qzboot.facade.support.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Set;

/**
 * @author zengzhihong
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SysUser extends BaseEntity {

    @NotBlank(message = "用户名不能为空")
    private String username;

    @JSONField(serialize = false)
    private String password;

    @TableField(exist = false)
    private String newPassword;

    @JSONField(serialize = false)
    private String salt;

    private String phone;

    private String avatar;

    private Integer state;

    private String remark;

    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Long createByUserId;

    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String createByUsername;

    private Long updateByUserId;

    private String updateByUsername;

    /**
     * 角色ID列表
     */
    @TableField(exist = false)
    private List<Long> roleIdList;

    /**
     * 权限列表
     */
    @TableField(exist = false)
    private Set<String> perms;


}
